home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
apps
/
255
/
applic
/
blit.c
next >
Wrap
C/C++ Source or Header
|
1988-06-14
|
1KB
|
56 lines
#include <obdefs.h>
#include <gemdefs.h>
#include <osbind.h>
#include "example.c"
#define WIDTH 0x0030
#define HEIGHT 0x0021
#define WORD_WIDTH 0x0003
int contrl[12],intin[128],ptsin[128],intout[128],ptsout[128];
int work_in[11],work_out[57];
int handle,phandle;
FDB sprite,screen;
int nul,pts[8],lpts[8],mx,my,but,rez;
main() {
appl_init();
phandle=graf_handle(&nul,&nul,&nul,&nul);
for(nul = 0; nul < 10; nul++)
work_in[nul] = 1;
work_in[10] = 2;
v_opnvwk(work_in,&handle,work_out);
rez = Getrez();
if(rez != 0) {
form_alert(1,"[3][This program run only in low resolution.][ OK ]");
goto end;
}
Setpalette(palette);
screen.fd_addr = 0L;
sprite.fd_addr = (long)example;
sprite.fd_w = WIDTH;
sprite.fd_h = HEIGHT;
sprite.fd_wdwidth = WORD_WIDTH;
sprite.fd_stand = 0;
sprite.fd_nplanes = 4;
but = 0;
pts[0] = 0; pts[1] = 0;
pts[2] = WIDTH-1; pts[3] = HEIGHT-1;
pts[4] = 320/2-WIDTH/2; pts[5] = 200/2-HEIGHT/2;
pts[6] = pts[4]+WIDTH-1; pts[7] = pts[5]+HEIGHT-1;
while(! but) {
Vsync();
vro_cpyfm(handle,3,pts,&sprite,&screen);
vq_mouse(handle,&but,&mx,&my);
}
end:
v_clsvwk(handle);
appl_exit();
}